﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Kane.WinForm;

namespace AutoReplace
{
    public partial class MainForm : Form
    {
        private string RulesFileInitDir = string.Empty;
        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            RulesFileInitDir = Directory.GetCurrentDirectory();
        }

        private void BTN_OpenRules_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog
            {
                InitialDirectory = RulesFileInitDir,//注意这里写路径时要用c:\\而不是c:\
                Filter = "Json文件|*.json|文本文件|*.txt|所有文件|*.*",
                RestoreDirectory = true,
                FilterIndex = 1,
                Multiselect=false,
            };
            if (openFile.ShowDialog() == DialogResult.OK)
            {
                TB_Rules.Text = openFile.FileName;
            }
        }

        
    }
}
